package com.dongdongmovie.service.impl;

import com.dongdongmovie.mapper.TTypeMapper;
import com.dongdongmovie.pojo.TType;
import com.dongdongmovie.service.TType_Service;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@DubboService
public class TType_ServiceImpl implements TType_Service {

    //注入mapper
    @Autowired
    private TTypeMapper tTypeMapper;

    //根据id查询数据
    @Override
    public TType showbyId(Integer id) {
        return tTypeMapper.selectByPrimaryKey(id);
    }

    //查询数据
    @Override
    public List<TType> show() {
        return tTypeMapper.selectByExample(null);
    }

    //添加数据
    @Override
    public int add(TType tCharnnel) {
        return tTypeMapper.insertSelective(tCharnnel);
    }

    //修改数据
    @Override
    public int update(TType tCharnnel) {
        return tTypeMapper.updateByPrimaryKeySelective(tCharnnel);
    }

    //删除数据
    @Override
    public int delete(Integer id) {
        return tTypeMapper.deleteByPrimaryKey(id);
    }
}
